package com.example.hydrogengenerator.ui.frag

import android.os.Bundle
import com.example.hydrogengenerator.R
import com.example.hydrogengenerator.base.BaseFragment
import com.example.hydrogengenerator.databinding.FragFactorySettingBinding
import com.example.hydrogengenerator.model.FactoryModel
import com.example.hydrogengenerator.model.MainViewModel
import me.hgj.jetpackmvvm.ext.nav

class FactorySettingFrag : BaseFragment<FactoryModel, FragFactorySettingBinding>() {
    override fun layoutId(): Int = R.layout.frag_factory_setting

    override fun initView(savedInstanceState: Bundle?) {
        mDatabind.model = mViewModel
        mDatabind.toolbar.setNavigationOnClickListener {
            mViewModel.save()
            appViewModel.factorySettingInfo.value = mViewModel.factorySettingBean.value
            nav().navigateUp()
        }
    }
}